import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
    // 打包所需
    base: '/yxt-vue/',
    plugins: [vue()],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    css: {
        preprocessorOptions: {
            scss: {
                javascriptEnabled: true,
                additionalData: '@import "./src/styles/_mediaQuery.scss";'
            }
        }
    },
    // 代理跨域
    server: {
        port: 4000,
        proxy: {
            '/api': {
                target: 'http://10.3.14.34:8078', // 测试服接口
                changeOrigin: true
            }
        }
    }
});
